Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions That Modify Movie Properties


Working With Movie User Data

Each movie, track, and media can contain a user data list, which your application can use in any way you want. A user data list contains all the user data for a movie, track, or media. Each user data list may contain one or more user data items. All QuickTime user data items share several attributes.

First, each user data item carries a type identifier. This type is similar to a Resource Manager resource type, and is stored in a long integer. Apple has reserved all lowercase user data type values. You are free to create user data type values using uppercase letters. Apple recommends using type values that begin with the © character (Option-G) to specify user data items that store text data.

The following user data types are currently defined:
'©nam'Movie's name
'©cpy'Copyright statement
'©day'Date the movie content was created
'©dir'Name of movie's director
ed1' to ed9'Edit dates and descriptions
'©fmt'Indication of movie format (computer-generated, digitized, and so on)
'©inf'Information about the movie
'©prd'Name of movie's producer
'©prf'Names of performers
'©req'Special hardware and software requirements
'©src'Credits for those who provided movie source content
'©wrt'Name of movie's writer

User data items of these types must contain text data only.

Second, the Movie Toolbox allows you to create more than one user data item in a user data list. Therefore, each user data item is identified by a unique index. Index values are assigned sequentially within a user data type and start at 1.

Finally, you may create alternate text for a given user data text item. For example, you may want to support multiple languages and may therefore want to create different text for each language. The Movie Toolbox allows you to specify different versions of the text of a single user data item. These versions are distinguished by their region code values.

The Movie Toolbox provides a number of functions that allow you to work with user data. Before you can work with the contents of a user data list, you must obtain a reference to the list. The GetMovieUserData, GetTrackUserData, or GetMediaUserData functions allow you to get a reference to a user data list. You can then use the GetUserData, AddUserData, and RemoveUserData functions to work with the items contained in the user data list. If your user data items contain text data, you can use the AddUserDataText, GetUserDataText, and RemoveUserDataText functions to work with the text of a user data item. Note that a single user data item can store either text or other data, but not both.

You can count the number of user data items of a specified type in a movie, track, or media by calling the CountUserDataType function. You can use the GetNextUserDataType function to scan all the types of user data in a specified user data list.

The Movie Toolbox also supplies a number of functions for the manipulation of user data. The SetUserDataItem and GetUserDataItem functions allow easy access to data stored in user data items. The NewUserData and DisposeUserData functions provide for the use of user data outside of the immediate context of QuickTime movies. Your applications and components can also create user data structures. The PutUserDataIntoHandle and the NewUserDataFromHandle functions permit user data to be stored and retrieved in a manner similar to public movies (also called atoms). See the chapter "Movie Resource Formats" in this book for details on atoms.


Subtopics
GetMovieUserData
GetTrackUserData
GetMediaUserData
GetNextUserDataType
CountUserDataType
AddUserData
GetUserData
RemoveUserData
AddUserDataText
GetUserDataText
RemoveUserDataText
SetUserDataItem
GetUserDataItem
NewUserData
DisposeUserData
PutUserDataIntoHandle
NewUserDataFromHandle

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996